<?php

class Application_Form_Faculty extends Validation_Form {

	public function init(){
		
		$this->setName("zendForm");
		$this->setMethod('post');
		$id = new Zend_Form_Element_Hidden('id');
		$id->addFilter('Int');
		$typeForm = $this->createElement('hidden','typeForm');
		$faculty = $this->createElement('text', 'designation');
		$faculty->setLabel('Wydział')
		->setRequired(TRUE)
		->setAttrib('size', 30)
		->addFilters(array(
		new Zend_Filter_StringTrim(),
		new Zend_Filter_StripNewlines(),
		new Zend_Filter_StripTags()
		))
		->addValidators(array(
		new Zend_Validate_NotEmpty(),
		new Zend_Validate_StringLength(array('min' => 5, 'max' => 30)),
		//new Zend_Validate_Alpha()
		));
		$short = $this->createElement('text', 'short');
		$short->setLabel('Skrót')
		->setRequired(TRUE)
		->setAttrib('size', 30)
		->addFilters(array(
		new Zend_Filter_StringTrim(),
		new Zend_Filter_StripNewlines(),
		new Zend_Filter_StripTags()
		))
		->addValidators(array(
		new Zend_Validate_NotEmpty(),
		new Zend_Validate_StringLength(array('min' => 2, 'max' => 10)),
		//new Zend_Validate_Alpha()
		));
		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setAttrib('id', 'submit');

		$this->addElements(array(
		$id,
		$faculty,
		$short,
		$typeForm,
		$submit,
		));
	}


}
?>
